docs: replace RFC copy-paste docstrings with Pythonic docstrings#1385
docs: replace RFC copy-paste docstrings with Pythonic docstrings#1385ykd007 wants to merge 3 commits into
Conversation
…lective#1244) Rewrote RFC-verbatim docstrings for the following properties: alarm.py: - Alarm.ACKNOWLEDGED: replaced RFC 9074 Purpose/Description wall-of-text with a concise summary, Return, Example and See also sections. - Alarm.TRIGGER: replaced RFC 5545 Purpose/Value-Type verbatim with a clear summary, type info, Example and See also. component.py: - Component.DTSTAMP / stamp: replaced 'RFC 5545: Conformance/Description' block with a Pythonic summary, context note, Example and See also. - Component.LAST_MODIFIED: same pattern - Pythonic summary, Example, See also. - Component.CREATED: same pattern - Pythonic summary, Example, See also. calendar.py: - Calendar.calendar_name: removed Property Parameters/Conformance/Description RFC headings; added See also. - Calendar.description: same cleanup. - Calendar.color: removed Property Parameters/Conformance/Description RFC headings; added CSS3 link reference and See also. - Calendar.prodid: replaced Conformance/Description verbatim with Pythonic summary, Example and See also. - Calendar.version: replaced Purpose RFC text with Pythonic summary + Example. - Calendar.calscale: replaced Conformance/Description/Compatibility with Pythonic summary, RFC 7529 note, Example and See also. - Calendar.method: replaced Description RFC block with Pythonic summary, iTIP/RFC 5546 reference, Example and See also. - Calendar.refresh_interval: replaced Conformance/Description headings with Pythonic summary, updated Raises, added Example and See also.
|
@ykd007 would you please resolve the merge conflicts by moving your change log entry into the new format that we adopted in 7.1.2, as documented at https://icalendar.readthedocs.io/en/stable/contribute/index.html#change-log-entry-format? |
|
@ykd007 would you also edit your PR description from |
stevepiercy
left a comment
There was a problem hiding this comment.
This is phenomenal work! Thank you!
There are some weird prepended and appended docstrings from a parent method that I'd like to see added to this PR, which will improve other docstrings automatically.
The change log needs to be moved, per the release of 7.1.1, and described in https://icalendar.readthedocs.io/en/stable/contribute/index.html#change-log-entry-format.
Other than that, I pretty much had only grammar and style fixes.
| changed in the alarm component. If the value of any "ACKNOWLEDGED" property | ||
| in the alarm changes and is greater than or equal to the trigger time of the alarm, | ||
| then clients SHOULD dismiss or cancel any "alert" presented to the calendar user. | ||
| """The UTC datetime at which this alarm was last sent or acknowledged. |
There was a problem hiding this comment.
When I looked at the rendered docs, I found that there was a snippet prepended to this docstring. Would you please revise the following:
Specifically, and possibly wrapped after using make format:
- f"""The {name} property. datetime in UTC
+ f"""The {name} property with all values converted to a :class:`~datetime.datetime` in UTC.
- All values will be converted to a datetime in UTC.
+ The two blank lines will ensure proper concatenation with a new paragraph to begin the description of the docstring.
| """The UTC datetime at which this alarm was last sent or acknowledged. | |
| """This property is the UTC datetime at which this alarm was last sent or acknowledged as defined in :rfc:`9074`. |
| then clients SHOULD dismiss or cancel any "alert" presented to the calendar user. | ||
| """The UTC datetime at which this alarm was last sent or acknowledged. | ||
|
|
||
| Defined in :rfc:`9074`. Setting this property allows calendar clients to |
There was a problem hiding this comment.
Moved into previous paragraph.
| Defined in :rfc:`9074`. Setting this property allows calendar clients to | |
| Setting this property allows calendar clients to |
| Defined in :rfc:`9074`. Setting this property allows calendar clients to | ||
| dismiss or suppress an alarm across multiple devices. Once set to a value | ||
| greater than or equal to the alarm's computed trigger time, conforming clients | ||
| will not re-fire the alarm. |
There was a problem hiding this comment.
| will not re-fire the alarm. | |
| will not refire the alarm. |
| >>> from icalendar import Alarm | ||
| >>> alarm = Alarm() | ||
| >>> alarm.ACKNOWLEDGED = datetime(2024, 1, 15, 10, 0, 0, tzinfo=timezone.utc) | ||
| >>> alarm.ACKNOWLEDGED # doctest: +ELLIPSIS |
There was a problem hiding this comment.
Inline comments don't render. Is the comment necessary?
| >>> alarm.ACKNOWLEDGED # doctest: +ELLIPSIS | |
| >>> alarm.ACKNOWLEDGED |
| datetime.datetime(2024, 1, 15, 10, 0, tzinfo=...) | ||
|
|
||
| See also: | ||
| :attr:`TRIGGER` — the time at which the alarm fires. |
There was a problem hiding this comment.
| :attr:`TRIGGER` — the time at which the alarm fires. | |
| :attr:`TRIGGER`, the time at which the alarm fires. |
| Analogous to a file's modification timestamp. This property is optional; | ||
| when absent, :attr:`last_modified` falls back to :attr:`DTSTAMP`. |
There was a problem hiding this comment.
| Analogous to a file's modification timestamp. This property is optional; | |
| when absent, :attr:`last_modified` falls back to :attr:`DTSTAMP`. | |
| It's analogous to a file's modification timestamp. This property is optional. | |
| When it's absent, :attr:`last_modified` falls back to :attr:`DTSTAMP`. |
| Analogous to a file's modification timestamp. This property is optional; | ||
| when absent, :attr:`last_modified` falls back to :attr:`DTSTAMP`. | ||
|
|
||
| Applicable to ``VEVENT``, ``VTODO``, ``VJOURNAL``, and ``VTIMEZONE`` |
There was a problem hiding this comment.
| Applicable to ``VEVENT``, ``VTODO``, ``VJOURNAL``, and ``VTIMEZONE`` | |
| This property is applicable to ``VEVENT``, ``VTODO``, ``VJOURNAL``, and ``VTIMEZONE`` |
| store. | ||
| """The UTC datetime when this calendar component was first created, per :rfc:`5545#section-3.8.7.1`. | ||
|
|
||
| Records when the calendar user agent originally stored the component. |
There was a problem hiding this comment.
| Records when the calendar user agent originally stored the component. | |
| This property records when the calendar user agent originally stored the component. |
| """The UTC datetime when this calendar component was first created, per :rfc:`5545#section-3.8.7.1`. | ||
|
|
||
| Records when the calendar user agent originally stored the component. | ||
| This property is optional; when absent, :attr:`created` falls back to |
There was a problem hiding this comment.
| This property is optional; when absent, :attr:`created` falls back to | |
| This property is optional. When it's absent, :attr:`created` falls back to |
| The property can be specified once in "VEVENT", | ||
| "VTODO", or "VJOURNAL" calendar components. The value MUST be | ||
| specified as a date with UTC time. | ||
| Applicable to ``VEVENT``, ``VTODO``, and ``VJOURNAL`` components. |
There was a problem hiding this comment.
| Applicable to ``VEVENT``, ``VTODO``, and ``VJOURNAL`` components. | |
| This property is applicable to ``VEVENT``, ``VTODO``, and ``VJOURNAL`` components. |
See #1244
Rewrites RFC copy-paste docstrings across
Alarm,Component, andCalendarinto clean Pythonic format with concise summaries, examples, and see-also references.Updated (12 properties across 3 files):
Alarm:ACKNOWLEDGED,TRIGGERComponent:DTSTAMP/stamp,LAST_MODIFIED,CREATEDCalendar:calendar_name,description,color,prodid,version,calscale,method,refresh_intervalAll 3 files pass
py_compilesyntax check.